#include<bits/stdc++.h>
using namespace std;

int main() {
	//1 2 3 4
	int a, b, c, d;
	for (a = 1; a <= 4; a++)
		for (b = 1; b <= 4; b++) {
			if (a == b)continue;
			for (c = 1; c <= 4; c++) {
				if (c == a || c == b)continue;
				d = 10 - a - b - c;
				cout << a << b << c << d << endl;
			}
		}
}

